/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vetor;


import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

/**
 *
 * @author Aluno
 */
public class Vetor {

  
    public static void main(String[] args) {
       
        String nome[]=new String[20];
       
        int i;
        Scanner ler=new Scanner(System.in);
        for (i=0;i<nome.length;i++){
            System.out.println("Digite o nome");
            nome[i]=ler.next();
            Arrays.sort(nome, new Comparator(){
           public int compare(Object ob1, Object ob2){
               return ((String)ob1).compareTo((String)ob2);
           }
       }                                                             
                    );
        }
        for (i=0;i<nome.length;i++){
           System.out.println("Nomes:"+nome[i]);
       }
  
     
    }
       
}

    

